From 8d89d373f360a38777e27c09d37850cef118cd4b Mon Sep 17 00:00:00 2001 From: Nicolas BESNARD Date: Fri, 21 Feb 2025 08:58:17 +0000 Subject: [PATCH] odhcp6c: add failure when -E option is used without ubus support enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Problem: The -E option disables the state script and relies only on ubus to emit events on state changes. But if odhcp6c is compiled without ubus support (ENABLE_UBUS flag omitted), odhcp6c has no way to signal state changes. Solution: Return an error when -E flag is used and ubus support is absent. Signed-off-by: Nicolas BESNARD Signed-off-by: Paul Donald Link: https://github.com/openwrt/odhcp6c/pull/106 Signed-off-by: Álvaro Fernández Rojas --- src/odhcp6c.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index e784b56..c36e3e3 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -347,6 +347,10 @@ int main(_unused int argc, char* const argv[]) break; case 'E': +#ifndef WITH_UBUS + syslog(LOG_ERR, "Failed to use ubus event: ENABLE_UBUS compilation flag missing"); + return 1; +#endif /* WITH_UBUS */ script = NULL; break; -- 2.30.2